<?php include_once 'Pecahan/sessionLontong.php'; ?>
<?php
if (isset($_GET['name_viewed'])!= NULL) {
    $name_viewed = $_GET['name_viewed'];
}
else if (isset($_SESSION['user_name'])!= NULL) {
    $name_viewed = $_SESSION['user_name'];
}
if (isset($_SESSION['user_name'])!= NULL) {
    $name_logon = $_SESSION['user_name'];
    $temp = new login();
    $role = $temp->getRole($name_logon );
}
else {
    $name_logon = NULL;
    $role = NULL;
}
?>
<?php
include_once'controller/registrasi.php';
include_once'controller/login.php';
include_once 'controller/follow.php';
?>
<?php $judul = 'Ganti Profpict'; ?>
<?php include_once 'Pecahan/header.php'; ?>

        <div id ="content" class="isipage">
            <div class="isipagestandar">
                <div>
                    <?php echo'<a href="upload_foto.php?name_viewed='.$name_viewed.'">Upload New Photo</a>'?>
                </div>
                <div class="space">

                </div>
                <div>
                    <div>
                        <?php
                        include_once 'controller/login.php';
                        include_once 'controller/photo.php';
                        $photo2 = new photo();
                        $result = $photo2->showPhotoByName($_SESSION['user_name']);
                        $iterate=0;
                        while($row = mysql_fetch_array($result)) {
                            ?>

                        <div class="floatleft" id="photogallery">
                                <?php
                                $iterate++;
                                $urlProfile = "profil.php?name_viewed=".$row['user_name'] ."&newPhoto=";
                                ?>
                            <a href="<?php echo $urlProfile.$row['url_photo']?>" >
                                <img id="<?php echo "foto_" . $iterate?>" name="<?php echo "foto_" . $iterate?>" src="<?php echo $row['url_photo'] ?>" alt="<?php echo "foto_" . $iterate?>" width="100" height="100"/>
                            </a>
                            <label><?php echo $row['key_word'] ?></label>
                        </div>
                            <?php } ?>
                    </div>

                </div>
            </div>
        </div>
        <?php include_once 'Chat/chat.php';?>
 <?php include_once 'Pecahan/footer.php'; ?>
